<Window
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="393" d:DesignWidth="937" SizeToContent="WidthAndHeight" Title="StackPanelDemo">
  <Grid>  
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="1*"/>
      <ColumnDefinition Width="1*"/>
    </Grid.ColumnDefinitions>
    
    <StackPanel>
      <Button Width="200" Height="50">explict size</Button>
      <Button Margin="30 20">with margin</Button>
      <!--because the alignment is 'strech' (by default), so actually left and right padding don't show effect-->
      <Button Padding="10 4">with padding, but horizontal alignment doesn't show effect</Button>
      <Button Padding="50 20" HorizontalAlignment="Center">with padding, and both direction show effect</Button>
      <Button HorizontalAlignment="Left">left alignment</Button>
      <Button HorizontalAlignment="Right">right alignment</Button>
      <Button HorizontalAlignment="Center">center alignment</Button>
      <Button HorizontalAlignment="Stretch">stretch alignment (default)</Button>
    </StackPanel>
    
    <StackPanel Grid.Column="1" Orientation="Horizontal">
      <!--by default, control stretch at the direction other than stretching direction, but you can specify different size to override this auto-size-->
      <Button>button1</Button>
      <Button Padding="10" Height="50">button2</Button>
      <Button>button3</Button>
    </StackPanel>
  
  </Grid>
</Window>